package bancosys.tec.services.example;

import jmine.tec.di.annotation.Injected;
import jmine.tec.services.annotations.Execution;
import jmine.tec.services.annotations.Output;
import jmine.tec.services.annotations.ServiceImplementor;
import jmine.tec.services.api.ActionsEnum;
import bancosys.tec.persist.audit.domain.AuditEntity;
import bancosys.tec.persist.dao.BaseDAO;
import bancosys.tec.persist.persister.PersisterFactory;

@ServiceImplementor(action = ActionsEnum.VALIDAR, stateless = true)
public class ServicoStateless {

    private final PersisterFactory factory;

    public ServicoStateless(@Injected PersisterFactory factory) {
        super();
        this.factory = factory;
    }

    @Execution
    @Output(propertyName = "persisterFactory")
    public Object executaServicoStateless(@Injected BaseDAO<AuditEntity> dao) throws Exception {
        dao.toString();
        return this.factory;
    }

}
